﻿
/*----------------------------------------------------------------//
// 文件名：MoRefFile.cs
// 文件功能描述：实体 MoRefFile.
// 
// 创建标识：2009-03-10
//
// 修改标识：
// 修改描述：
//----------------------------------------------------------------*/
#region MoRefFile
using System;
using System.Data;
using System.Globalization;
using System.Text;
using System.Xml;
using System.Data.Common;
namespace EQT.Model
{
	/// <summary>
	/// 业务实体MoRefFile
	/// </summary>
	public partial class MoRefFile:ICloneable
	{
		#region 表RefFile的字段
		private string _rf_id;
		private string _file_id;
		private string _eid;
		#endregion
		
		#region 构造函数
		public MoRefFile()
		{
		    
		    
		    
		}
		#endregion
		
		#region 拷贝构造函数

		public MoRefFile(MoRefFile item)
		{
			item.CopyTo(this);
		}
		#endregion
		
		#region 带参数构造函数
	    public MoRefFile(string rf_id,string file_id,string eid)
		{
		this._rf_id=rf_id;
		this._file_id=file_id;
		this._eid=eid;
		}
		#endregion
		
		#region 表RefFile的字段属性
		/// <summary>
		/// RF_ID
		/// </summary>
		public string Rf_Id
		{
			get {return _rf_id;}
			set {_rf_id=value;}
		}
		/// <summary>
		/// FILE_ID
		/// </summary>
		public string File_Id
		{
			get {return _file_id;}
			set {_file_id=value;}
		}
		/// <summary>
		///实际是一个外键。那个实体关联了一个文件，那么那个实体的主键则记录到这里。
		/// </summary>
		public string Eid
		{
			get {return _eid;}
			set {_eid=value;}
		}
		#endregion
		
		#region 辅助函数
		/// <summary>
		/// 拷贝函数
		/// </summary>
		public MoRefFile CopyTo(MoRefFile item)
        {
		    item.Rf_Id=this.Rf_Id;
		    item.File_Id=this.File_Id;
		    item.Eid=this.Eid;
			return item;
        }
		/// <summary>
		/// 克隆函数
		/// </summary>		
		public object Clone()
        {
            MoRefFile NewRefFile=new MoRefFile();
		    NewRefFile._rf_id=this._rf_id;
		    NewRefFile._file_id=this._file_id;
		    NewRefFile._eid=this._eid;
			return NewRefFile;
		}
		
		private static MoRefFile _empty = new MoRefFile(string.Empty,string.Empty,string.Empty);
        public static MoRefFile Empty
        {
            get
            {
                return _empty;
            }
        }
		
		///<summary>
		///判断对象是否相等
		///<summary>
		public override bool Equals(object obj)
        {
            if (base.Equals(obj))
            {
                return true;
            }
            else
            {
                MoRefFile NewRefFile = obj as MoRefFile;
                if (NewRefFile == null)
                {
                    return false;
                }
                else
                {
				if (NewRefFile.Rf_Id==this.Rf_Id && NewRefFile.File_Id==this.File_Id && NewRefFile.Eid==this.Eid)		
					{
                        return true; 
                    }
                }

            }
            return false;
            
        }
		///TODO:you should modify GetHashCode by yourself.
		public override int GetHashCode()
		{
			return base.GetHashCode();
		} 

		public override string ToString()
        {
		   return String.Format("Rf_Id={0}/File_Id={1}/Eid={2}",_rf_id,_file_id,_eid);
		 
		}
		#endregion
		
		#region DataTable Help Function
		///<summary>
		///DataRow转换成Model
		///</summary>
		public void Row2Model(DataRow row)
		{
		    if(row["RF_ID"]!=null && row["RF_ID"]!=DBNull.Value)
			{
			    this.Rf_Id = (string)row["RF_ID"];
			}
			else
			{
				this.Rf_Id =string.Empty;
			}
		    if(row["File_ID"]!=null && row["File_ID"]!=DBNull.Value)
			{
			    this.File_Id = (string)row["File_ID"];
			}
			else
			{
				this.File_Id =string.Empty;
			}
		    if(row["EID"]!=null && row["EID"]!=DBNull.Value)
			{
			    this.Eid = (string)row["EID"];
			}
			else
			{
				this.Eid =string.Empty;
			}
		}
		
		///<summary>
		///Model转换成DataRow
		///</summary>
	　　public void Model2Row(DataRow row)
		{
			row["RF_ID"] = this.Rf_Id;
			row["File_ID"] = this.File_Id;
			row["EID"] = this.Eid;
		}
		#endregion
	}
}
#endregion
